package com.dc.refactoring._5_简化函数调用._13_ReplaceErrorCodeWithException.unCheckException;

public class Test {
    public static void main(String[] args){
        double amount = 100;
        Account1 account = new Account1();

        if (!account.canWithDraw(amount)) {
            // 处理结束流程
        } else {
            account.withDraw(amount);
            // 继续处理其他业务
        }

        // ---------------------------------------------------------


        Account2 account2 = new Account2();
        account2.withDraw2(amount);
        // 继续处理其他业务
    }
}
